<?php
/**
 * Created by PhpStorm.
 * User: trisatria
 * Date: 1/6/14
 * Time: 12:51 PM
 */

return array(
    'controllers' => array(
        'invokables' => array(
            'Frontend\Controller\Index' => 'Frontend\Controller\IndexController',
            'Frontend\Controller\Raovat' => 'Frontend\Controller\RaovatController',
            'Frontend\Controller\User' => 'Frontend\Controller\UserController',
            'Frontend\Controller\Commend' => 'Frontend\Controller\CommendController',
            'Frontend\Controller\Categories' => 'Frontend\Controller\CategoriesController',
            'Frontend\Controller\Product' => 'Frontend\Controller\ProductController',
            'Frontend\Controller\Login' => 'Frontend\Controller\LoginController',
            'Frontend\Controller\Logout' => 'Frontend\Controller\LogoutController',
            'Frontend\Controller\Register' => 'Frontend\Controller\RegisterController',
            'Frontend\Controller\Sitemap' => 'Frontend\Controller\SitemapController',
            'Frontend\Controller\Page' => 'Frontend\Controller\PageController',
            'Frontend\Controller\Search' => 'Frontend\Controller\SearchController',
            'image_service'=> 'Imagine\Gd\Imagine'
        ),
    ),
    'router' => array(
        'routes' => array(
            'home' => array(
                'type' => 'segment',
                'options' => array (
                    'route'    => '/',
                    'defaults' => array(
                        'controller' => 'Frontend\Controller\Index',
                        'action'     => 'index',
                    ),
                ),
            ),
            'login' => array(
                'type' => 'segment',
                'options' => array (
                    'route'    => '/login[/:action][/:id][/:param]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                        'param'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Frontend\Controller\Login',
                        'action'     => 'index',
                    ),
                ),
            ),
            'logout' => array(
                'type' => 'segment',
                'options' => array (
                    'route'    => '/logout[/:action][/:id][/:param]',
                    'defaults' => array(
                        'controller' => 'Frontend\Controller\Logout',
                        'action'     => 'index',
                    ),
                ),
            ),
            'register' => array(
                'type' => 'segment',
                'options' => array (
                    'route'    => '/register[/:action][/:id][/:param]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                        'param'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Frontend\Controller\Register',
                        'action'     => 'index',
                    ),
                ),
            ),
           'frontendtopic' => array(
               'type'    => 'segment',
                'options' => array(
                    'route'    => '/raovat[/:action][/:slug][/:id][/:username]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                        'param'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Frontend\Controller\Raovat',
                        'action'     => 'index',
                    ),
                ),
            ),

           'frontenduser' => array(
               'type'    => 'segment',
                'options' => array(
                    'route'    => '/user[/:action][/:param]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'param'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Frontend\Controller\User',
                        'action'     => 'index',
                    ),
                ),
            ),

           'admincategories' => array(
                'type'    => 'segment',
                'options' => array(
                    'route'    => '/categories[/:action][/:id]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Frontend\Controller\Categories',
                        'action'     => 'index',
                    ),
                ),
            ),

           'frontendcommend' => array(
                'type'    => 'segment',
                'options' => array(
                    'route'    => '/commend[/:action][/:id]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Frontend\Controller\Commend',
                        'action'     => 'index',
                    ),
                ),
            ),
            'page' => array(
                'type'    => 'segment',
                'options' => array(
                    'route'    => '/page[/:action][/:slug][/:id]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Frontend\Controller\Page',
                        'action'     => 'index',
                    ),
                ),
            ),
            'search' => array(
                'type'    => 'segment',
                'options' => array(
                    'route'    => '/search[/:action][/:search_val][/:search_cat][/:search_loc][/:search_type]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id'     => '[0-9]+',
                    ),
                    'defaults' => array(
                        'controller' => 'Frontend\Controller\search',
                        'action'     => 'index',
                    ),
                ),
            ),
            'sitemap' => array(
                'type' => 'literal',
                'options' => array(
                    'route' => '/sitemap',
                    'defaults' => array(
                        'controller' => 'Frontend\Controller\Sitemap',
                        'action'     => 'index',
                    ),
                ),
                'may_terminate' => true,
                'child_routes' => array(
                    'xml' => array(
                        'type' => 'literal',
                        'options' => array(
                            'route' => '/xml',
                            'defaults' => array(
                                'action' => 'xml',
                            ),
                        ),
                    ),
                ),
            ),
        ),
    ),

    'view_manager' => array(
        'display_not_found_reason' => true,
        'display_exceptions'       => true,
        'doctype'                  => 'HTML5',
        'not_found_template'       => 'error/404',
        'exception_template'       => 'error/index',
        'template_path_stack' => array(
            'frontend' => __DIR__ . '/../view',
        ),
        'template_map' => array(
            'frontend/layout'   => __DIR__ . '/../../../public/templates/front/layout.phtml',
            'error/404'               => __DIR__ . '/Frontend/view/error/404.phtml',
            'error/index'             => __DIR__ . '/Frontend/view/error/index.phtml',
        )
    ),

);